Freeze Panes in Excel

The code example above shows how to create a freeze pane in Excel using IronXL for Python, locking rows and columns so they remain visible while scrolling. This is a valuable feature for keeping header rows or label columns in place when reviewing large datasets.

CreateFreezePane(column, row)

The first CreateFreezePane overload takes a column count and a row count to define the frozen area. For example, worksheet.CreateFreezePane(1, 4) creates a freeze pane covering column A and rows 1–4.

CreateFreezePane(column, row, subsequentColumn, subsequentRow)

This overload creates a freeze pane and also applies pre-scrolling to the worksheet. For example, worksheet.CreateFreezePane(5, 2, 6, 7) freezes columns A–E and rows 1–2, with the view scrolled to show 1 additional column and 5 additional rows. When the worksheet is first opened, it will display columns A–E, G–... and rows 1–2, 8–...

If you work with large data tables in Excel, freezing rows or columns keeps important labels visible while scrolling through the rest of the worksheet.

Learn How to Add Freeze Panes in Excel with Python

Ready to Get Started?
Version: 2026.4 just released
Still Scrolling Icon

Still Scrolling?

Want proof fast?
run a sample watch your data become a spreadsheet.